{include file="common/head_s"/}
<style type="text/css">
.layui-table-view{ margin: 0px!important; }
</style>
<div class="main">  
    <div class="layui-card-header">通道管理</div> 
    <div class="pd15"> <table class="layui-table layui-hide" id="channellist" lay-filter="channellist"></table></div> 
</div> 
<script type="text/html" id="lvte">
   {{d.rate}} %
</script>
<script type="text/html" id="orderall"><div title="点击查看订单明细" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="orderlist">订单明细</div></script>
<script src="/static/plugins/layui/layui.js"></script> 
<script>
    layui.use(['layer','table','form'], function() {
        var table = layui.table,form = layui.form, $ = layui.jquery, layer = layui.layer;
        var tableIn = table.render({
            id: 'listss',
            elem: '#channellist', 
            url: '{:url("index")}',
            method: 'post', 
            page: true,
            cols: [[ 
                {field: 'title', title: '通道名称',align: 'center', width:138, fixed: true},
                {field: 'price', title: '单价/CNY',align: 'center', width: 100, fixed: true},
                {field: 'cionname', title: '币种',align: 'center', width: 138}, 
                {field: 'shopname', title: '所属商城',align: 'center', width: 138}, 
                {field: 'opentype', title: '状态',align: 'center', width: 100},
                {field: 'addtime', title: '开通时间',align: 'center', width: 143},
                {field: 'numberall', title: '销售数量',align: 'center', width: 158},
                {field: 'money_total', title: '累计收款',align: 'center', width: 168}, 
                {field: 'rate', title: '费率',align: 'center', width: 80,templet: '#lvte'},  
                {field: 'id', title: '识别ID', align: 'center',width: 80},
                {title: '订单明细',align: 'center', width: 100,templet: '#orderall'}, 
            ]],
            limit: 10 //每页默认显示的数量
        });  
        table.on('tool(channellist)', function(obj) {
            var data = obj.data; 
            if(obj.event === 'orderlist') { 
                layer.open({
                    type: 2,
                    title:'订单列表',
                    shade: 0.5,
                    shadeClose: true,
                    area: ['80%', '90%'], 
                    content:"{:url('order/ordermin')}?channelid="+data.id,
                });    
            } 
        }); 
    });
</script>
</body>
</html>